﻿
//定义导航图活动链接的颜色

function on(o) {
    with (o.rows[0].cells[1]) {
        firstChild.style.color = "#aa0000";
        firstChild.style.borderBottomColor = "#440000";
        children[1].style.color = "#440000";
    }
}

function off(o) {
    with (o.rows[0].cells[1]) {
        firstChild.style.color = "#0000aa";
        firstChild.style.borderBottomColor = "#999999";
        children[1].style.color = "#444444";
    }
}

// 功能：展开/折叠主界面左侧导航菜单
// 周彤 2005/06/17
function showNav(o) {
    var navIndex;
    var oTr = o.parentElement.parentElement.nextSibling; 			// 菜单主体对象:tr
    var oImg = o.rows[0].cells[1].getElementsByTagName("img")[0]; 		// 菜单箭头对象:img
    var oTrBar = document.all("trBar");
    var oImgBar = document.all("imgBar");

    navIndex = parseInt(o.id.substr(6))

    if (oTr) {
        if (oTr.style.display == "") {
            oTr.style.display = "none";
            oImg.src = "/_nav/imgs/nav_arrow_right.gif";

            //if(navIndex!=0)
            //{
            //	o.parentElement.parentElement.parentElement.parentElement.parentElement.style.marginTop = "0px";
            //}

            //o.parentElement.parentElement.parentElement.parentElement.parentElement.style.marginBottom = "0px";
            o.parentElement.parentElement.parentElement.parentElement.style.borderBottomWidth = "0px";

            //if(navIndex>0) oTrBar[navIndex].parentElement.parentElement.style.borderTopWidth = "0px";
            //if(oTrBar[navIndex+1]) oTrBar[navIndex+1].parentElement.parentElement.style.borderTopWidth = "0px";

        }
        else {

            if (oTrBar) {
                for (var i = 0; i < oTrBar.length; i++) {
                    oTrBar[i].style.display = "none";

                    oTrBar[i].parentElement.parentElement.style.borderBottomWidth = "0px";

                    //if(i!=0)
                    //{
                    //	oTrBar[i].parentElement.parentElement.parentElement.style.marginTop = "0px";
                    //	oTrBar[i].parentElement.parentElement.style.borderTopWidth = "0px";
                    //}

                    //oTrBar[i].parentElement.parentElement.parentElement.style.marginBottom = "0px";
                }
            }


            if (oImgBar) {
                for (var i = 0; i < oImgBar.length; i++) {
                    oImgBar[i].src = "/_nav/imgs/nav_arrow_right.gif";
                }
            }


            //if(navIndex>0) oTrBar[navIndex].parentElement.parentElement.style.borderTopWidth = "1px";
            //if(oTrBar[navIndex+1]) oTrBar[navIndex+1].parentElement.parentElement.style.borderTopWidth = "1px";

            oTr.style.display = "";
            oImg.src = "/_nav/imgs/nav_arrow_down.gif";
            o.parentElement.parentElement.parentElement.parentElement.style.borderBottomWidth = "1px";

            //o.parentElement.parentElement.parentElement.parentElement.parentElement.style.marginTop = "10px";
            //o.parentElement.parentElement.parentElement.parentElement.parentElement.style.marginBottom = "10px";

        }
    }
}

/////////////////////////////// 以下是框架刷新相关函数，请参阅《主框架结构文档》	周彤 2005/06/17 ////////////////////////////////////
// 功能：在导航页面选择系统
function selSysInNav(o) {
    try {
        if (o != undefined) {
            var sURL = o.url + "?sys=" + escape(o.sys);
            var oStage = "/FuncList.aspx?sys=" + escape(o.sys)

            navigate(sURL);
            parent.stage.navigate(oStage);
            parent.loc.document.all("spLocation").innerHTML = parent.loc.document.all("spLocation").innerHTML + " >> " + "<a style='font-weight:bold;' onclick='selFuncInLoc(this)' href='" + oStage + "' target='stage'>" + o.sys + "</a>";
        }
    }
    catch (e) { }
}

// 功能：在主内容区选择系统
function selSysInStage(o) {
    try {
        if (o != undefined) {
            var sURL = o.url + "?sys=" + escape(o.sys);
            var oStage = "/FuncList.aspx?sys=" + escape(o.sys)

            parent.nav.navigate(sURL);
            parent.stage.navigate(oStage);
            parent.loc.document.all("spLocation").innerHTML = parent.loc.document.all("spLocation").innerHTML + " | " + "<a style='font-weight:bold;' onclick='selFuncInLoc(this)' href='" + oStage + "' target='stage'>" + o.sys + "</a>";
        }
    }
    catch (e) { }
}

// 功能：在导航页面选择模块
function selFuncInNav(o) {
    try {
        if (o != undefined) {
            var oTb = o.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; 	// 导航菜单所在table
            var sGroupName = oTb.rows[0].cells[0].getElementsByTagName("table")[0].rows[0].cells[2].innerText; 				// 模块组名称
            var sURL = o.url;

            // 判断是否是末级功能
            if (sURL.toLowerCase() == "/funclist.aspx")
                sURL = sURL + "?func=" + escape(o.innerText);

            // 拼写位置字符串
            parent.loc.document.all("spLocation").innerHTML = "<b>" + sGroupName + "</b> | " + "<a style='font-weight:bold;' onclick='selFuncInLoc(this)' href='" + sURL + "' target='stage'>" + o.innerText + "</a>";

            // 刷新主内容区
            parent.stage.navigate(sURL);
        }
    }
    catch (e) { }
}

// 功能：在主内容区选择模块
function selFuncInStage(o) {
    try {
        if (o != undefined) {
            var sURL = o.url;

            // 判断是否是末级功能
            if (sURL.toLowerCase() == "/funclist.aspx")
                sURL = sURL + "?FuncCode=" + escape(o.func);

            // 刷新主内容区
            navigate(sURL);

            // 设置位置字符串
            parent.loc.document.all("spLocation").innerHTML = parent.loc.document.all("spLocation").innerHTML + " | " + "<a style='font-weight:bold;' onclick='selFuncInLoc(this)' href='" + sURL + "' target='stage'>" + o.funcname + "</a>";
        }
    }
    catch (e) { }
}

// 功能：从位置上选择模块
function selFuncInLoc(o) {
    var sLoc = document.all("spLocation").innerHTML.toString();
    var sA = o.outerHTML.toString();

    // 截取当前超链接之前的html代码
    document.all("spLocation").innerHTML = sLoc.substring(0, sLoc.indexOf(sA) + sA.length);
}

// 功能：返回系统导航页面
function backSysPage() {
    top.location.href = "/Inex2.aspx";
}

function GoFromMyDesktop(sPara) {
    //top.nav.location="/FuncNavigation.aspx?AppCode=&FuncCode=" + FuncCode + "&sParam="+escape(sPara);   
    top.nav.NavFunc(sPara);
}

// 功能：增加新的位置链接
function addLocation(name, href, target) {
    if (top.loc.document.all("spLocation"))
        top.loc.document.all("spLocation").innerHTML = top.loc.document.all("spLocation").innerHTML + " &gt;&gt; " + "<b><a href='" + href + "' target='" + target + "'>" + name + "</a></b>";
}


